<?php
namespace PhalconRest\Models;
use \PhalconRest\Exceptions\HTTPException;

class Message extends \Phalcon\Mvc\Model
{
    /*
     * 设置表
     */
    public function getSource(){
        return "destoon_buy_6";
    }


    /*
     * 向表 destoon_buy_data_6 插入值
     * @param $db    数据库连接
     * @param $data  数据
     */
    public function insertBuyData($db,$data)
    {
        $buy_data = "";
        if(isset($data['itemid']) && isset($data['introduce'])){
            $sql_data = " insert into destoon_buy_data_6 set itemid={$data['itemid']},content='".$data['introduce']."' ";
            $buy_data =$db->query($sql_data);
        }
        return $buy_data;
    }
}